import { 
    findNodeHandle,
    UIManager
 } from "react-native";

//根据ref获得组件属性
export function getSize(ref){
    const handle = findNodeHandle(ref);
    return new Promise((resolve) => {
      UIManager.measure(handle, (x, y, width, height, pageX, pageY) => {
          resolve({
              x,
              y,
              width,
              height,
              pageX,
              pageY
          });
      });
    });
}